import { translate } from '@/utils/i18n'
export const formItems = [
    {
        filed: 'listType',
        type: 'select',
        label: translate('tjlx'),
        clearable: false,
        options: [
            { value: '1', label: translate('jlkstj') },
            { value: '2', label: translate('zjkstj') }]
    },
    {
        filed: 'venueId',
        type: 'select',
        label: translate('venue'),
        labelCode: 'name',
        valueCode: 'id',
        options: []
    },
    {
        filed: 'time',
        type: 'daterange',
        clearable: false,
        label: translate('skrq'),
        pickerOptions: {
            shortcuts: [{
                text: translate('jin7'),
                onClick (picker) {
                    const end = new Date()
                    const start = new Date()
                    end.setTime(end.getTime())
                    start.setTime(start.getTime() - 3600 * 1000 * 24 * 6)
                    picker.$emit('pick', [start, end])
                }
            },
            {
                text: translate('jin30'),
                onClick (picker) {
                    const end = new Date()
                    const start = new Date()
                    end.setTime(end.getTime())
                    start.setTime(start.getTime() - 3600 * 1000 * 24 * 29)
                    picker.$emit('pick', [start, end])
                }
            },
            {
                text: translate('jin60'),
                onClick (picker) {
                    const end = new Date()
                    const start = new Date()
                    end.setTime(end.getTime())
                    start.setTime(start.getTime() - 3600 * 1000 * 24 * 59)
                    picker.$emit('pick', [start, end])
                }
            },
            {
                text: translate('jin90'),
                onClick (picker) {
                    const end = new Date()
                    const start = new Date()
                    end.setTime(end.getTime())
                    start.setTime(start.getTime() - 3600 * 1000 * 24 * 89)
                    picker.$emit('pick', [start, end])
                }
            }],
            disabledDate (time) {
                var curDate = new Date(new Date().toLocaleDateString()).getTime()
                var preDate = new Date(curDate)
                return time.getTime() > preDate
            }
        }
    },
    {
        filed: 'courseName',
        type: 'input',
        label: translate('courseName')
    },
    {
        filed: 'teacherName',
        type: 'input',
        label: translate('jlmc')
    },
    {
        filed: 'phone',
        type: 'input',
        label: translate('phone')
    },

]
export const queryFormConfig = {
    formItems,
    online: true
}
